As computer systems have advanced, graphics processing units (GPUs) have become increasingly advanced. Correspondingly, the interfaces for connecting GPUs to computer systems have become increasingly advanced. Currently, the Peripheral Component Interconnect Express (PCIe) interface is commonly used to connect a GPU to a computer system. PCIe is used in consumer, server, and industrial applications, as a motherboard-level interconnect and as an expansion card interface for add-in boards. The PCIe specification provides for multiple virtual channels for communication between a device, such as a GPU, and other parts of the computer system, such as a chipset.
Unfortunately, while PCIe supports multiple virtual channels, some operating systems only allow the use of a single virtual channel. The use of a single virtual channel for communication between devices is insufficient to prevent communication deadlock in some situations. For example, based on PCIe ordering rules and use of a single virtual channel, there is a dependency when there is a read from a Central Processing Unit (CPU) downstream to an endpoint device, such as a GPU when the requested data is in main memory. The CPU may issue a read to a GPU which needs to be satisfied by reading from main memory when the GPU has used up the local memory and data is therefore stored in the main memory. Based on the ordering rules, the response data to the read request comes from main memory downstream to the GPU. The GPU is trying to handle CPU request and the system may have an ordering rule preventing the GPU from receiving data from main memory until the CPU requests are handled thereby resulting in deadlock because the CPU request to the GPU remains “pending” until satisfied. In other words, the ordering rules implemented by the chipset may not allow traffic to pass other downstream traffic and other traffic dependent on the read completion, thereby causing deadlock. So the GPU in this case is prevented from reading main memory (to respond to the CPU request) while that same CPU request is pending.
Under the PCIe specification, a second virtual channel would solve this problem by removing this dependency between the traffic that is originally from the CPU towards the GPU and traffic initiated by the GPU on the behalf of, and to service, the request that comes from the CPU. However, depending on the operating system, a second virtual channel may not be available for use as the operating system can limit GPU communication to a single virtual channel.
Thus, there is a need to prevent deadlock in such a system when communicating over a single virtual channel.